#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <functional>
#include <boost/bind.hpp>
#include <boost/shared_ptr.hpp>

using namespace std;

int main(int atrgc, char** argv)
{
	const int size = 100;
	char c[size];
	char c2[size];
	string s("Hello,world!"),s2;
	int i =6789,i2;
	char ch = 's',ch2;
	double d = 1.234,d2;
	sprintf(c,"%d%c%f%s",i,ch,d,s.c_str());
	cout<<c<<endl;
	sscanf(c,"%d%c%f%s",&i2,&ch2,&d,c2);
	cout<<"i2  -> "<<i2<<endl
	    <<"ch2 -> "<<ch2<<endl
	    <<"d   -> "<<d2<<endl
	    <<"c   -> "<<c2<<endl;

	return 0;
}
